package cn.corffen.test.algorithm.leetcode.easy;

public class ListNode {
   public int val;
   public ListNode next;

    ListNode head;

    public ListNode(int val) {
        this.val = val;
    }


    public void add(int val){

    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        ListNode node = this;
        while (node != null) {
            sb.append("->").append(node.val);
            node = node.next;
        }
        return sb.toString();
    }
}
